package com.itheima.stream;

import java.util.*;
import java.util.stream.Stream;

public class Demo1Stream {
    public static void main(String[] args) {
        ArrayList<String> list = new ArrayList<>();
        list.add("zhangsan");
        list.add("lisi");
        list.add("wangwu");
        list.stream().forEach(s-> System.out.println(s));
        System.out.println("-------------");
        TreeMap<String,Integer> map = new TreeMap<>();
        map.put("zhangsan",23);
        map.put("lisi",24);
        map.put("wangwu",25);
       map.entrySet().stream().forEach(s-> System.out.println(s));
        System.out.println("------------------");
        int[] arr = {1,2,3,4,5};
        Arrays.stream(arr).forEach(s-> System.out.println(s));
        System.out.println("----------------");
        Stream.of(1,2,3,4,5).forEach(s-> System.out.println(s));
    }
}
